home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
cug232
/
set.st
< prev
next >
Wrap
Text File
|
1987-06-17
|
640b
|
26 lines
Class Set :Collection
| list |
[
new
list <- List new
| add: newElement
(list includes: newElement)
ifFalse: [list add: newElement]
| remove: oldElement ifAbsent: exceptionBlock
list remove: oldElement ifAbsent: exceptionBlock
| size
^ list size
| occurrencesOf: anElement
^ (list includes: anElement) ifTrue: [1] ifFalse: [0]
| first
^ list first
| next
^ list next
]